

# Each class corresponds to one accent.
#  Class for General United Kingdom
class _GUKinter(dict):
    """Four featrue dicts for GUK"""

    dict_type = None

    
    def __init__(self, path_guk_inter=config.PATH_INTER_GUK):
        """Instantiate and populate this current dict."""

        super(dict, self).__init__()

        assert self.dict_type in ('pos', 'pron', 'ortho', 'freq',)

        with open(path_guk_inter) as f:
            for line in f.readlines():
                word, pron_num, pos, pron, ortho, freq = line.split(':')
                value = locals()[self.dict_type]
                try:
                    self[word].append(value)
                except KeyError:
                    self[word] = [value]

@singleton
class GukPOS(_GUKinter):
    dict_type = 'pos'

@singleton
class GukPron(_GUKinter):
    dict_type = 'pron'

@singleton
class GukOrtho(_GUKinter):
    dict_type = 'ortho'

@singleton
class GukFreq(_GUKinter):
    dict_type = 'freq'


#  Class for Edinburgh
class _EDIinter(dict):
    """Four feature dicts for EDI"""

    dict_type = None

    
    def __init__(self, path_edi_inter=config.PATH_INTER_EDI):
        """Instantiate and populate this current dict."""

        super(dict, self).__init__()

        assert self.dict_type in ('pos', 'pron', 'ortho', 'freq',)

        with open(path_edi_inter) as f:
            for line in f.readlines():
                word, pron_num, pos, pron, ortho, freq = line.split(':')
                value = locals()[self.dict_type]
                try:
                    self[word].append(value)
                except KeyError:
                    self[word] = [value]

@singleton
class EdiPOS(_EDIinter):
    dict_type = 'pos'

@singleton
class EdiPron(_EDIinter):
    dict_type = 'pron'

@singleton
class EdiOrtho(_EDIinter):
    dict_type = 'ortho'

@singleton
class EdiFreq(_EDIinter):
    dict_type = 'freq'


#  Class for Leeds
class _LDSinter(dict):
    """Four feature dicts for LDS"""

    dict_type = None

    
    def __init__(self, path_lds_inter=config.PATH_INTER_LDS):
        """Instantiate and populate this current dict."""

        super(dict, self).__init__()

        assert self.dict_type in ('pos', 'pron', 'ortho', 'freq',)

        with open(path_lds_inter) as f:
            for line in f.readlines():
                word, pron_num, pos, pron, ortho, freq = line.split(':')
                value = locals()[self.dict_type]
                try:
                    self[word].append(value)
                except KeyError:
                    self[word] = [value]

@singleton
class LdsPOS(_LDSinter):
    dict_type = 'pos'

@singleton
class LdsPron(_LDSinter):
    dict_type = 'pron'

@singleton
class LdsOrtho(_LDSinter):
    dict_type = 'ortho'

@singleton
class LdsFreq(_LDSinter):
    dict_type = 'freq'


#  Class for Leeds Person 1
class _LDS1inter(dict):
    """Four feature dicts for LDS1"""

    dict_type = None

    
    def __init__(self, path_lds1_inter=config.PATH_INTER_LDS1):
        """Instantiate and populate this current dict."""

        super(dict, self).__init__()

        assert self.dict_type in ('pos', 'pron', 'ortho', 'freq',)

        with open(path_lds1_inter) as f:
            for line in f.readlines():
                word, pron_num, pos, pron, ortho, freq = line.split(':')
                value = locals()[self.dict_type]
                try:
                    self[word].append(value)
                except KeyError:
                    self[word] = [value]

@singleton
class Lds1POS(_LDS1inter):
    dict_type = 'pos'

@singleton
class Lds1Pron(_LDS1inter):
    dict_type = 'pron'

@singleton
class Lds1Ortho(_LDS1inter):
    dict_type = 'ortho'

@singleton
class Lds1Freq(_LDS1inter):
    dict_type = 'freq'


#  Class for Cardiff
class _CDFinter(dict):
    """Four feature dicts for CDF"""

    dict_type = None

    
    def __init__(self, path_cdf_inter=config.PATH_INTER_CDF):
        """Instantiate and populate this current dict."""

        super(dict, self).__init__()

        assert self.dict_type in ('pos', 'pron', 'ortho', 'freq',)

        with open(path_cdf_inter) as f:
            for line in f.readlines():
                word, pron_num, pos, pron, ortho, freq = line.split(':')
                value = locals()[self.dict_type]
                try:
                    self[word].append(value)
                except KeyError:
                    self[word] = [value]

@singleton
class CdfPOS(_CDFinter):
    dict_type = 'pos'

@singleton
class CdfPron(_CDFinter):
    dict_type = 'pron'

@singleton
class CdfOrtho(_CDFinter):
    dict_type = 'ortho'

@singleton
class CdfFreq(_CDFinter):
    dict_type = 'freq'


#  Class for Abercrave Person 1
class _ABD1inter(dict):
    """Four feature dicts for ABD1"""

    dict_type = None

    
    def __init__(self, path_abd1_inter=config.PATH_INTER_ABD1):
        """Instantiate and populate this current dict."""

        super(dict, self).__init__()

        assert self.dict_type in ('pos', 'pron', 'ortho', 'freq',)

        with open(path_abd1_inter) as f:
            for line in f.readlines():
                word, pron_num, pos, pron, ortho, freq = line.split(':')
                value = locals()[self.dict_type]
                try:
                    self[word].append(value)
                except KeyError:
                    self[word] = [value]

@singleton
class Abd1POS(_ABD1inter):
    dict_type = 'pos'

@singleton
class Abd1Pron(_ABD1inter):
    dict_type = 'pron'

@singleton
class Abd1Ortho(_ABD1inter):
    dict_type = 'ortho'

@singleton
class Abd1Freq(_ABD1inter):
    dict_type = 'freq'


#  Class for New York Person 0
class _NYCinter(dict):
    """Four feature dicts for NYC"""

    dict_type = None

    
    def __init__(self, path_nyc_inter=config.PATH_INTER_NYC):
        """Instantiate and populate this current dict."""

        super(dict, self).__init__()

        assert self.dict_type in ('pos', 'pron', 'ortho', 'freq',)

        with open(path_nyc_inter) as f:
            for line in f.readlines():
                word, pron_num, pos, pron, ortho, freq = line.split(':')
                value = locals()[self.dict_type]
                try:
                    self[word].append(value)
                except KeyError:
                    self[word] = [value]

@singleton
class NycPOS(_NYCinter):
    dict_type = 'pos'

@singleton
class NycPron(_NYCinter):
    dict_type = 'pron'

@singleton
class NycOrtho(_NYCinter):
    dict_type = 'ortho'

@singleton
class NycFreq(_NYCinter):
    dict_type = 'freq'


#  Class for New York Person 1
class _NYC1inter(dict):
    """Four feature dicts for NYC1"""

    dict_type = None

    
    def __init__(self, path_nyc1_inter=config.PATH_INTER_NYC1):
        """Instantiate and populate this current dict."""

        super(dict, self).__init__()

        assert self.dict_type in ('pos', 'pron', 'ortho', 'freq',)

        with open(path_nyc1_inter) as f:
            for line in f.readlines():
                word, pron_num, pos, pron, ortho, freq = line.split(':')
                value = locals()[self.dict_type]
                try:
                    self[word].append(value)
                except KeyError:
                    self[word] = [value]

@singleton
class Nyc1POS(_NYC1inter):
    dict_type = 'pos'

@singleton
class Nyc1Pron(_NYC1inter):
    dict_type = 'pron'

@singleton
class Nyc1Ortho(_NYC1inter):
    dict_type = 'ortho'

@singleton
class Nyc1Freq(_NYC1inter):
    dict_type = 'freq'


#  Class for General American
class _GAMinter(dict):
    """Four feature dicts for GAM"""

    dict_type = None

    
    def __init__(self, path_gam_inter=config.PATH_INTER_GAM):
        """Instantiate and populate this current dict."""

        super(dict, self).__init__()

        assert self.dict_type in ('pos', 'pron', 'ortho', 'freq',)

        with open(path_gam_inter) as f:
            for line in f.readlines():
                word, pron_num, pos, pron, ortho, freq = line.split(':')
                value = locals()[self.dict_type]
                try:
                    self[word].append(value)
                except KeyError:
                    self[word] = [value]

@singleton
class GamPOS(_GAMinter):
    dict_type = 'pos'

@singleton
class GamPron(_GAMinter):
    dict_type = 'pron'

@singleton
class GamOrtho(_GAMinter):
    dict_type = 'ortho'

@singleton
class GamFreq(_GAMinter):
    dict_type = 'freq'


#  Class for South Carolina
class _SCAinter(dict):
    """Four feature dicts for SCA"""

    dict_type = None

    
    def __init__(self, path_sca_inter=config.PATH_INTER_SCA):
        """Instantiate and populate this current dict."""

        super(dict, self).__init__()

        assert self.dict_type in ('pos', 'pron', 'ortho', 'freq',)

        with open(path_sca_inter) as f:
            for line in f.readlines():
                word, pron_num, pos, pron, ortho, freq = line.split(':')
                value = locals()[self.dict_type]
                try:
                    self[word].append(value)
                except KeyError:
                    self[word] = [value]

@singleton
class ScaPOS(_SCAinter):
    dict_type = 'pos'

@singleton
class ScaPron(_SCAinter):
    dict_type = 'pron'

@singleton
class ScaOrtho(_SCAinter):
    dict_type = 'ortho'

@singleton
class ScaFreq(_SCAinter):
    dict_type = 'freq'


#  Class for County Claire Person 1
class _CCL1inter(dict):
    """Four feature dicts for CCL1"""

    dict_type = None

    
    def __init__(self, path_ccl1_inter=config.PATH_INTER_CCL1):
        """Instantiate and populate this current dict."""

        super(dict, self).__init__()

        assert self.dict_type in ('pos', 'pron', 'ortho', 'freq',)

        with open(path_ccl1_inter) as f:
            for line in f.readlines():
                word, pron_num, pos, pron, ortho, freq = line.split(':')
                value = locals()[self.dict_type]
                try:
                    self[word].append(value)
                except KeyError:
                    self[word] = [value]

@singleton
class Ccl1POS(_CCL1inter):
    dict_type = 'pos'

@singleton
class Ccl1Pron(_CCL1inter):
    dict_type = 'pron'

@singleton
class Ccl1Ortho(_CCL1inter):
    dict_type = 'ortho'

@singleton
class Ccl1Freq(_CCL1inter):
    dict_type = 'freq'


#  Class for General Australian
class _GAUinter(dict):
    """Four feature dicts for GAU"""

    dict_type = None

    
    def __init__(self, path_gau_inter=config.PATH_INTER_GAU):
        """Instantiate and populate this current dict."""

        super(dict, self).__init__()

        assert self.dict_type in ('pos', 'pron', 'ortho', 'freq',)

        with open(path_gau_inter) as f:
            for line in f.readlines():
                word, pron_num, pos, pron, ortho, freq = line.split(':')
                value = locals()[self.dict_type]
                try:
                    self[word].append(value)
                except KeyError:
                    self[word] = [value]

@singleton
class GauPOS(_GAUinter):
    dict_type = 'pos'

@singleton
class GauPron(_GAUinter):
    dict_type = 'pron'

@singleton
class GauOrtho(_GAUinter):
    dict_type = 'ortho'

@singleton
class GAUFreq(_GAUinter):
    dict_type = 'freq'


# Class for General New Zealand
class _GNZinter(dict):
    """Four feature dicts for GNZ"""

    dict_type = None

    
    def __init__(self, path_gau_inter=config.PATH_INTER_GNZ):
        """Instantiate and populate this current dict."""

        super(dict, self).__init__()

        assert self.dict_type in ('pos', 'pron', 'ortho', 'freq',)

        with open(path_gnz_inter) as f:
            for line in f.readlines():
                word, pron_num, pos, pron, ortho, freq = line.split(':')
                value = locals()[self.dict_type]
                try:
                    self[word].append(value)
                except KeyError:
                    self[word] = [value]

@singleton
class GnzPOS(_GNZinter):
    dict_type = 'pos'

@singleton
class GnzPron(_GNZinter):
    dict_type = 'pron'

@singleton
class GnzOrtho(_GNZinter):
    dict_type = 'ortho'

@singleton
class GnzFreq(_GNZinter):
    dict_type = 'freq'
